
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObject;
using DataAccessLayer;

namespace BusinessLogic
{
    /// <summary>
    /// Define PhieuChuyenKhoUtil class. This class user for BussinessLayer.

    /// </summary>
    public class PhieuChuyenKhoUtil
    {
        /// <summary>
        /// Define function Insert for PhieuChuyenKho Object.
        /// </summary>
        /// <param name="t">object data need Insert.</param>
        /// <returns>
        ///    True: if insert successfull.
        ///    False: if insert error.
        ///</returns>
        public static bool Insert(PhieuChuyenKho t)
        {

            return PhieuChuyenKhoDao.Insert(t);
        }
        /// <summary>
        /// Define function Update for PhieuChuyenKho Object.
        /// </summary>
        /// <param name="t">project data need updated.</param>
        /// <returns>
        ///    True: if update successful.
        ///    False: if update Error.
        ///</returns>
        public static bool Update(PhieuChuyenKho t)
        {

            return PhieuChuyenKhoDao.Update(t);
        }
        /// <summary>
        /// Get All PhieuChuyenKho object from table PhieuChuyenKho.
        /// </summary>
        /// <returns>List PhieuChuyenKho object.</returns>
        public static List<PhieuChuyenKhoResult> GetAll()
        {
            return PhieuChuyenKhoDao.GetAll();
        }
        /// <summary>
        /// Search PhieuChuyenKho object in table PhieuChuyenKho.
        /// </summary>
        /// <param name="t">Condition for Search.</param>

        /// <returns>List PhieuChuyenKhoResult objects.</returns>

        public static List<PhieuChuyenKhoResult> SearchPhieuChuyenKhoSomeCondition(PhieuChuyenKho t)
        {
            return PhieuChuyenKhoDao.SearchPhieuChuyenKhoSomeCondition(t);
        }
        /// <summary>
        /// Get a PhieuChuyenKho data object by primary key. 
        /// </summary>
        /// <param name="maPhieuChuyenKho" >This is primary key.</param>
        /// <returns>A PhieuChuyenKho object.</returns>

        public static PhieuChuyenKho Get(Int64 maPhieuChuyenKho)
        {
            return PhieuChuyenKhoDao.Get(maPhieuChuyenKho);
        }
        /// <summary>
        /// This function to Delete PhieuChuyenKho object by primary key.
        /// </summary>
        /// <param name="maPhieuChuyenKho" >This is primary key.</param>
        /// <returns>If succesful return True else  return False.</returns>

        public static bool Delete(Int64 maPhieuChuyenKho)
        {

            return PhieuChuyenKhoDao.Delete(maPhieuChuyenKho);
        }
        public static bool Update(PhieuChuyenKho obj, List<ChiTietPhieuChuyenKho> lstChiTiet)
        {
            if (lstChiTiet != null && lstChiTiet.Count > 0)
                return PhieuChuyenKhoDao.Update(obj, lstChiTiet);
            else
                return false;
        }
        public static Int64 Insert(PhieuChuyenKho obj, List<ChiTietPhieuChuyenKho> lstChiTiet)
        {
            if (lstChiTiet != null && lstChiTiet.Count > 0)
                return PhieuChuyenKhoDao.Insert(obj, lstChiTiet);
            else
                return 0;
        }
        public static List<ChiTietPhieuChuyenKhoResult> GetByMaPhieuChuyenKho(Int64 maPhieuChuyen)
        {
            return ChiTietPhieuChuyenKhoDao.GetByMaPhieuChuyenKho(maPhieuChuyen);
        }
        public static List<ChiTietPhieuChuyenKhoDetail> GetChiTietPhieuChuyenKhoDetailByMaPhieuChuyenKho(Int64 maPhieu)
        {
            return ChiTietPhieuChuyenKhoDao.GetChiTietPhieuChuyenKhoDetailByMaPhieuChuyenKho(maPhieu);
        }
    }
}